package 第五轮工作.上海电力大学;

import org.jsoup.Connection;
import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
import org.jsoup.nodes.Element;

import java.io.IOException;

public class SHDLU {
    public static void main(String[] args) throws IOException {
        String url = "https://dqxy.shiep.edu.cn/2483/list.htm";
        Connection connect = Jsoup.connect(url);
        Document post = connect.post();
        for (Element wpArticleList : post.getElementsByClass("wp_article_list")) {
            for (Element element : wpArticleList.getElementsByTag("li")) {
                for (Element articleTitle : element.getElementsByClass("Article_Title")) {
                    String N_url = "https://dqxy.shiep.edu.cn" + articleTitle.getElementsByTag("a").attr("href");
                    Connection connect1 = Jsoup.connect(N_url);
                    try {
                        Document post1 = connect1.post();
                        for (Element msoNormalTable : post1.getElementsByTag("tbody")) {
                            System.out.println(msoNormalTable.getElementsByTag("td").text());
                            //1 5 9 13 15
                        }
                    } catch (IOException e) {
                        System.out.println("404");
                    }

                }

            }

        }

    }
}
